//
// Created by yangchao on 2022/6/8.
// 136. 只出现一次的数字: https://leetcode.cn/problems/single-number/
//

#include <vector>
using namespace std;

//位运算
class SingleNumber {
public:
    int singleNumber(vector<int>& nums) {
        int res = 0;
        for(int num: nums) {
            res ^= num;
        }
        return res;
    }
};
